package com.honey.mybatis.generator.criteria.field;

import com.honey.compilation.java.Decoration;
import com.honey.compilation.java.Field;
import com.honey.compilation.java.JavaVisibility;
import com.honey.core.types.FullyQualifiedJavaType;
import com.honey.mybatis.generator.AbstractField;
import com.honey.mybatis.generator.criteria.CriteriaConstant;

public class CriteriaField extends AbstractField {

	private static final FullyQualifiedJavaType TYPE = new FullyQualifiedJavaType("java.util.List<"+CriteriaConstant.CRITERION_CLASS_NAME+"> ");

	private static final String[] JAVA_DOC =new String[]{
		"判断规则。 " 
	};
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getFieldName()
	 */
	@Override
	protected String getFieldName() {
		return CriteriaConstant.CRITERION_FIELD_NAME;
	}

	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getType()
	 */
	@Override
	protected FullyQualifiedJavaType getType() {
		return TYPE;
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getDecoration()
	 */
	@Override
	protected Decoration getDecoration() {
		Decoration answer = super.getDecoration();
		answer.setVisibility(JavaVisibility.PRIVATE);
		
		return answer;
	}

	/* (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractField#getJavaDoc()
	 */
	@Override
	protected String[] getJavaDoc() {
		
		return JAVA_DOC;
	}
	
	public static void main(String []args){
		CriteriaField f = new CriteriaField();
		Field field =  f.createField() ;
		System.out.println(field.compiledContent(1));
	}
}
